package com.example.wenliangjiudian.service.impl;

import com.example.wenliangjiudian.entity.RoomType;
import com.example.wenliangjiudian.mapper.RoomTypeMapper;
import com.example.wenliangjiudian.service.RoomTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomTypeServiceImpl implements RoomTypeService {

    @Autowired
    private RoomTypeMapper roomTypeMapper;

    @Override
    public List<RoomType> selectAll() {
        return roomTypeMapper.selectAll();
    }

    @Override
    public void delete(Integer typeId) {
        roomTypeMapper.delete(typeId);
    }

    @Override
    public void add(String typeName) {
        roomTypeMapper.insert(typeName);
    }

    @Override
    public RoomType getByTypeId(Integer typeId) {
        return roomTypeMapper.getByTypeId(typeId);
    }

    @Override
    public void update(Integer typeId, String typeName) {
        roomTypeMapper.update(typeId,typeName);
    }
}
